(function () {
    /**
     * 特殊牌型弹窗扩展
     * @class AlertSpecialUI
     * @constructor
     */
    function AlertSpecialUI() {
        AlertSpecialUI.super(this);

        this.CardPanel.removeChildren();
    }
    Laya.class(AlertSpecialUI, "ui.Room.ResultSpecial", ui.Room.ResultSpecialUI);

    var _proto = AlertSpecialUI.prototype;
    /**
     * @public
     * 显示特殊牌型弹窗
     * 
     * @param {Object}   specialData 特殊牌型弹窗相关数据
     * @param {Function} callback    回调函数
     */
    _proto.show = function (specialData, callback) {
        this.closeHandler = new Laya.Handler(this, callback);

        var bg = this.bg;
        var name = this.specialName;
        var cardPanel = this.CardPanel;
        cardPanel.removeChildren();

        bg.scale(0, 0);
        Laya.Tween.to(bg, {scaleX : 1, scaleY : 1}, 500, Laya.Ease.circIn);

        name.text = specialData.name;
        name.scale(2, 2);
        name.alpha = 0;
        Laya.Tween.to(name, {scaleX : 1, scaleY : 1, alpha : 1}, 500, Laya.Ease.circIn);

        for(var i = 0; i < 13; i++){
            var _card = new ui.Com.Card();
            _card.x = 380;
            _card.point = specialData.cards[i];
            _card.halfPass();
            cardPanel.addChild(_card);
            Laya.Tween.to(_card, {x : (i * 38) + 85}, 300, Laya.Ease.elasticOut);
        }

        this.popup();
        Laya.SoundManager.playSound("sound/" + specialData.type + ".mp3");

        Laya.timer.once(4000, this, function () {
            this.close();
        })
    }
})();